import request from '~/utils/resquest'

//  查询树
export const hardwareTreeGet = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-monitor/hardware/tree',
    method: 'GET',
    params
  })
}

//  查询监控箱点位分布
export const hardwarePointPositionGet = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-monitor/hardware/pointPosition',
    method: 'GET',
    params
  })
}

//  查询监控箱运行数据
export const hardwareGetRunDataGet = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-monitor/hardware/getRunData',
    method: 'GET',
    params
  })
}

//  查询监控箱警报
export const hardwareGetRunAlarmDataDataGet = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-monitor/hardware/getRunAlarmData',
    method: 'GET',
    params
  })
}

//  执行设备指令
export const excuteCommandParamPost = <T>(params: T) =>
  request({
    url: '/api/gxsaas-protocol/protocol/excuteCommand',
    method: 'post',
    data: params
  })

//  获取操作及命令
export const hardwareGetCommandParam = <T>(params: T) =>
  request({
    url: '/api/gxsaas-monitor/hardware/getCommandParam',
    method: 'GET',
    params
  })
